package com.jic.member.controller.manage;

import com.jic.common.base.vo.PageResult;
import com.jic.common.base.vo.RestResult;
import com.jic.member.entity.MememberGrowthLog;
import com.jic.member.request.MemberGrowthLogRequest;
import com.jic.member.request.MemberGrowthRuleRequest;
import com.jic.member.response.MemberGrowthLogResponse;
import com.jic.member.response.MemberGrowthRuleResponse;
import com.jic.member.service.MememberGrowthLogService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("memberGrowthLog")
public class MememberGrowthLogController {
     @Autowired
     private MememberGrowthLogService mememberGrowthLogService;

     @ApiOperation("流水表列表查询")
     @RequestMapping("getMemberLogList")
     public RestResult<PageResult<MemberGrowthLogResponse>> getMemberLogList(@RequestBody MemberGrowthLogRequest memberGrowthRuleRequest){
         return mememberGrowthLogService.queryPage(memberGrowthRuleRequest);
     }

     @ApiOperation("流水表新增")
     @RequestMapping("addGrowthLog")
     public  RestResult<Long> addMemberLog(@RequestBody MemberGrowthLogRequest memberGrowthLogRequest){
          return mememberGrowthLogService.insert(memberGrowthLogRequest);
     }
}
